package edu.sctu.nieyu.day20150514.texttwo;

/**
 * Created by user01 on 2015/5/14.
 */
public class StudentTwo extends Abstract {

    int num;
    Message[] Array;
    public StudentTwo(Message[] Array){
        super(Array);
        this.Array = Array;
    }

    @Override
    public void setInformation() {

        for (int i = 0; i <Array.length ; i++) {
            if (Array[i].getSex() == "man" && Array[i].getAge()>19) {
                System.out.println("姓名："+Array[i].getName()+"年龄："+Array[i].getAge()+"性别："+Array[i].getSex());
                num++;
            }else {
                System.out.println("无相关信息。");
            }

        }
        System.out.println("满足的人数共有："+num);
    }
}
